package com.mogu.comment.annotion;

import com.mogu.comment.Messages;
import com.mogu.comment.constraint.BooleanValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Description:不在能知，而在能行
 *
 * @author: 梁西华
 * @date: 2020/6/11/10:39
 **/
@Target({ElementType.TYPE,ElementType.FIELD,ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {BooleanValidator.class})
public @interface BooleanNotNull {
    boolean required() default true;
    //String CK_NOT_NULL_DEFAULT = "can not be null";
    String message() default Messages.CK_NOT_NULL_DEFAULT;
    String value() default "";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
